package com.hnguigu.health.houduan.jpx.controller_jpx;

import com.hnguigu.health.houduan.jpx.service_jpx.TCheckGroupService;
import com.hnguigu.health.houduan.jpx.service_jpx.TCheckgroupCheckitemSer;
import com.hnguigu.health.houduan.jpx.service_jpx.TCheckitemSer;
import com.hnguigu.health.pojo.TCheckgroup;
import com.hnguigu.health.pojo.TCheckgroupCheckitem;
import com.hnguigu.health.pojo.TCheckitem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import java.util.List;

@Controller
@RequestMapping("/TCheckgroupCheckitemController")
public class TCheckgroupCheckitemController {
    @Autowired(required = false)
    TCheckgroupCheckitemSer tCheckgroupCheckitemSer;
    @Autowired(required = false)
    TCheckitemSer tCheckitemSer;


    //1.2C 通过检查项的编号拿检查内容
    @RequestMapping("/allitemBygroupId/{checkgroupId}")
    @ResponseBody
    public List<TCheckitem> allitemBygroupId(@PathVariable Integer checkgroupId) {
        System.out.println(checkgroupId);
        List<TCheckitem> tCheckitems = tCheckitemSer.allCheckitembygroupid(checkgroupId);
        System.out.println(tCheckitems+"------------------");
        return tCheckitems;
    }
}
